package com.hkbigdata.transfrom;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author liuanbo
 * @creat 2023-04-19-17:35
 * @see 2194550857@qq.com
 */
public class Flink03_TransForm_Fliter_Anonymous {
    public static void main(String[] args) throws Exception {
        //1.创建环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        /*env.fromElements(1, 2, 3, 5, 7, 9, 11)
                .filter(new FilterFunction<Integer>() {
                    @Override
                    public boolean filter(Integer value) throws Exception {

                        return value % 2 == 0;
                    }
                }).print();*/


        env
                .fromElements(10, 3, 5, 9, 20, 8)
                .filter(value -> value % 2 == 0)
                .print();

        env.execute();
    }
}
